Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: OpenDoc Class Reference /
Part 1 - Classes and Methods / ODPart


UndoAction

The UndoAction method should undo the specified action.

void UndoAction (in ODActionData actionState);
actionState
A byte array whose buffer contains the data previously logged by this part to allow it to undo the action.
DISCUSSION
OpenDoc calls this method when the user chooses to undo an action of this part.

Your part may need to give the user the capability of reversing the effects of recently executed commands. If it does, your part's UndoAction method should perform any reverse editing necessary to restore itself to the state it possessed before the specified action.

Your part is responsible for notifying the clipboard whenever a Cut, Copy, or Paste operation is done, undone, or redone. When a part cuts an object to the clipboard, a reference to the object should be saved in an undo action. If your part's UndoAction method is called, it should reinstate the object into its content model from its undo information and notify the clipboard that the cut was undone.

OVERRIDING
When you subclass ODPart, you can override this method. Your override method must not call its inherited method; that is, your override method must implement this method's functionality completely.

EXCEPTIONS
kODErrDoesNotUndo
The specified action is not an undo action of this part.
SEE ALSO
The ODActionData type (page 898).
The ODPart::RedoAction method (page 539).
Table 2-1 on page 89 in OpenDoc Programmer's Guide.
"Undo, Redo" on page 250 in OpenDoc Programmer's Guide.
"Implementing Undo" on page 258 in OpenDoc Programmer's Guide.
"Undoing an Action" on page 261 in OpenDoc Programmer's Guide.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
17 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help